const dbPool = require('../config/dbpool');
const modelsUser = {
	// 根据userid获取某个用户的信息
	userInfo(query){
		return new Promise((resolve,reject)=>{
			dbPool.connect("SELECT * FROM user WHERE userid=?", query.userid, (err, data) => {
				if (!err) {
					resolve({
						code: 200,
						list: data
					});
				} else {
					reject(err)
				}
			})
		})
	}
};
module.exports = modelsUser;